package com.aspose.cells;

public class LegendEntry {
   private Legend a;
   private boolean b;
   private Font c;
   private int d = -1;
   private int e;
   private boolean f = true;
   private int g = 0;

   LegendEntry(Legend legend, int index) {
      this.a = legend;
      this.e = index;
   }

   public boolean isDeleted() {
      return this.b;
   }

   public void setDeleted(boolean value) {
      this.b = value;
   }

   public Font getFont() {
      if (this.c == null) {
         this.c = new Font(this.a.getChart().j(), (Object)null, true);
         this.c.setSize(10);
         if (this.d != -1) {
            Font var1 = (Font)this.a.getChart().j().z().get(this.d > 4 ? this.d - 1 : this.d);
            this.c.c(var1);
            zbi var2 = this.a.getChart().c(this.d);
            if (var2 != null) {
               zbi var3 = new zbi(var2.f, 0, false);
               var3.a(var2);
               this.c.a((Object)var3);
            }
         } else {
            if (this.a.g() != null) {
               this.c.c(this.a.getFont());
            }

            if (this.getAutoScaleFont()) {
               this.c.a((Object)(new zbi(this.a.getChart(), this.c.getSize(), true)));
            }
         }
      }

      return this.c;
   }

   /** @deprecated */
   public Font getTextFont() {
      return this.getFont();
   }

   Font a() {
      return this.c == null && this.d != -1 ? this.a.getChart().j().j(this.d) : this.c;
   }

   int b() {
      return this.d;
   }

   void a(int var1) {
      this.d = var1;
   }

   int c() {
      return this.e;
   }

   void b(int var1) {
      this.e = var1;
   }

   public boolean getAutoScaleFont() {
      return this.f;
   }

   public void setAutoScaleFont(boolean value) {
      if (this.f != value) {
         if (value) {
            if (this.c != null) {
               this.c.a((Object)(new zbi(this.a.getChart(), this.c.getSize(), true)));
            }
         } else {
            this.getFont().a((Object)null);
         }

         this.f = value;
      }
   }

   void a(boolean var1) {
      this.f = var1;
   }

   /** @deprecated */
   public int getBackground() {
      return this.g;
   }

   /** @deprecated */
   public void setBackground(int value) {
      this.g = value;
   }

   public int getBackgroundMode() {
      return this.g;
   }

   public void setBackgroundMode(int value) {
      this.g = value;
   }

   void a(LegendEntry var1) {
      this.f = var1.f;
      this.g = var1.g;
      this.b = var1.b;
      this.d = -1;
      if (var1.c == null && var1.d == -1) {
         this.c = null;
      } else {
         this.c = new Font(this.a.getChart().j(), (Object)null, true);
         this.c.c(var1.getFont());
         if (var1.getFont().c() != null && var1.f) {
            zbi var2 = (zbi)var1.getFont().c();
            zbi var3 = new zbi(this.a.getChart(), 0, false);
            var3.a(var2);
            this.c.a((Object)var3);
         }
      }

   }
}
